//
//  IMIBaseNSStringHelper.h
//  IMIBase
//
//  Created by Travis on 09-7-12.
//  Copyright 2009 imi.im All rights reserved.
//

#import "IMIBasePrefix.h"
#import <CoreGraphics/CGGeometry.h>

@interface NSString (IMIBase)

//generate a new uuid string
+ (NSString *) stringWithUUID;

//return the string's md5 value as string
- (NSString *) MD5;
+ (NSString *) MD5OfFile:(NSString*)path;
//return nsstring without any whitespace
- (NSString *)trimWhitespace;

#pragma mark base64
//return the string's base64 value as string
- (NSString *) encodeToBase64;

//decode the string's base64 value as string
- (NSString *) decodeFromBase64;

#pragma mark CGPoint
//return CGPoint from a string with format "1.25,13.4"
- (CGPoint) toCGPoint;

#pragma mark CGSize
//return CGSize from a string with format "1.25,13.4"
- (CGSize) toCGSize;

#pragma mark File
//make sure the string self is a file path!
//return file name without extention, eg: I'm Sorry
- (NSString*)fileName;
//return file extention, eg: mp3,caf,png...
- (NSString*)fileType;
//return file's parent folder, eg: /tmp/ab/
- (NSString*)fileParentFolder;
@end
